# # -*- coding: utf-8 -*-
# # @Time : 2021/12/10 11:06
# # @Author : Limusen
# # @File : baidu_demo_01
#
# """
#
# 页面元素均为百度
#
# 可自行查找元素
#
# """
#
# import os
# import time
# from selenium import webdriver
#
# png_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'sample', 'png_file', '{}')
# # 方法一 将驱动python的安装路径下
# driver = webdriver.Chrome()
# driver.get("https://www.baidu.com")
# driver.implicitly_wait(10)
#
# # ===============通过id定位===============#
# # # 从上面截图可以发现,这个元素有一个id属性,我们可以通过id去定位这个属性值
# # # 然后进行操作
# # driver.find_element_by_id("kw").send_keys("今天你吃饭了没")
# # time.sleep(2)
# # driver.find_element_by_id("su").click()
# # time.sleep(2)
# # driver.get_screenshot_as_file(png_file_path.format("baidu_id.png"))
# # driver.quit()
# # ===============通过id定位===============#
#
# # ===============通过name-class定位===============#
# # driver.find_element_by_name("wd").send_keys("今天你吃饭了没")
# # # 注意class一个属性如果为空格 需要用.来进行拼接才能识别到
# # driver.find_element_by_class_name("bg.s_btn").click()
# # ===============通过name定位===============#
#
#
# # ===============通过tag_name定位===============#
#
# # 用的比较少
#
# # ===============通过tag_name定位===============#
#
#
# # ===============通过link_text定位===============#
# # driver.find_element_by_link_text("hao123").click()
# # driver.get_screenshot_as_file(png_file_path.format("baidu_demo_link_text.png"))
# # ===============通过link_text定位===============#
#
# # ===============通过xpath定位===============#
# # driver.find_element_by_xpath('//span/input[@id="kw"]').send_keys("今天吃饭了吗")
# # driver.find_element_by_class_name("bg.s_btn").click()
# # ===============通过xpath定位===============#
#
# # ===============通过css定位===============#
# driver.find_element_by_css_selector('#kw').send_keys("今天吃饭了吗")
# driver.find_element_by_class_name("bg.s_btn").click()
# # ===============通过css定位===============#
#
#
#
#

import json

str1 = "{\"ops\":[{\"insert\":\"# -*- coding: utf-8 -*-\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# @Time : 2021/12/10 10:50\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# @Author : Limusen\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# @File : demo_ui_02\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\\n\"},{\"insert\":\"import os\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"import time\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"from selenium import webdriver\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\\n\"},{\"insert\":\"# 方法一 将驱动python的安装路径下\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver = webdriver.Chrome()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.get(\\\"https://www.baidu.com\\\")\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 最小化\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.minimize_window()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"time.sleep(1)\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 最大化\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.maximize_window()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"time.sleep(1)\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 前进\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.forward()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 后退\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.back()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 刷新\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.refresh()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 截图\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.get_screenshot_as_file(\\\"files.png\\\")\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"time.sleep(1)\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"# 关闭浏览器\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\"},{\"insert\":\"driver.quit()\"},{\"attributes\":{\"code-block\":true},\"insert\":\"\\n\\n\"},{\"attributes\":{\"size\":\"12px\"},\"insert\":{\"image\":\"https://img2020.cnblogs.com/blog/1242217/202112/1242217-20211210110016030-1058227922.png\"}},{\"insert\":\"\\n\"}]}"
ss = json.loads(str1)
print(ss)